package com.itheima.movement.controller;

import com.itheima.entity.vo.Result;
import com.itheima.movement.service.MovementLikeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author :wujunjie
 * createTime :2022-12-23 14:29
 * description :
 */
@RestController
@RequestMapping("movementService/MovementLike")
public class MovementLikeController {

    @Autowired
    private MovementLikeService movementLike;

    @PostMapping
    public Result insertLike(@RequestParam(name = "movementId") String movementId){
        Boolean insertLike=movementLike.insertLike(movementId);
        if (insertLike){
            return Result.success();
        }
        return Result.error();
    }

    @DeleteMapping
    public Result deleteLike(@RequestParam String id){
        Boolean deleteLike=movementLike.deleteLike(id);
        if (deleteLike){
            return Result.success();
        }
        return Result.error();
    }

}
